package com.dfbz.homework12;

import java.lang.reflect.Method;
import java.util.Arrays;

public class main {
    public static void main(String[] args) throws NoSuchMethodException {
        Class<Test> testClass = Test.class;
        //获取注释的对象
        Method test = testClass.getDeclaredMethod("test");
        Book annotation = test.getAnnotation(Book.class);
        String value=annotation.value();
        Double price=annotation.price();
        String[] authors=annotation.authors();
        System.out.println("书名:"+value+"--价格:"+price+"--作者:"+ Arrays.toString(authors));
    }
}
